package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.wap.dto.SalesPrizesDTO;
import com.financing.wap.dao.ISalesPrizesDao;
import com.financing.wap.common.SqlName;
/**
 * sales_prizes  
 * 奖项配置表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("salesPrizesDao")
public class SalesPrizesDaoImpl extends BaseDaoImpl<SalesPrizesDTO, java.lang.Integer> implements ISalesPrizesDao {


	@Override
	public int insert(SalesPrizesDTO salesPrizes) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.SalesPrizesSql.insert, salesPrizes);
	}

	@Override
	public void update(SalesPrizesDTO salesPrizes) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.SalesPrizesSql.update, salesPrizes);
	}

	@Override
	public void updateForce(SalesPrizesDTO salesPrizes) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.SalesPrizesSql.updateForce, salesPrizes);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.SalesPrizesSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<SalesPrizesDTO> queryList(SalesPrizesDTO salesPrizes) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.SalesPrizesSql.queryList, salesPrizes);
	}

	@Override
	public int queryListCount(SalesPrizesDTO salesPrizes) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.SalesPrizesSql.queryListCount, salesPrizes);
	}

	@Override
	public SalesPrizesDTO loadById(Integer id) throws SQLException {
		return  (SalesPrizesDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.SalesPrizesSql.loadById,id);
	}
	@Override
	public Class<SalesPrizesDTO> getEntityClass() {
		return SalesPrizesDTO.class;
	}

	@Override
	public List<SalesPrizesDTO> queryListSend(SalesPrizesDTO salesPrizes)
			throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.SalesPrizesSql.queryListSend, salesPrizes);
	}

	@Override
	public List<Map<String, String>> salesPrizesPeopleList()
			throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.SalesPrizesSql.salesPrizesPeopleList);
	}
 	
}
